package com.cashmama.market.api.domain.enums;

/**
 * @program: market-api
 * @description
 * @author: frank
 * @create: 2020-01-03 16:45
 **/
public enum CategoryTypeDescEnum {
    HOT(1,"Hot"),
    OPTIMIZATION(2,"Optimization"),
    ONGOING(3,"Ongoing");

    CategoryTypeDescEnum(Integer type, String name) {
        this.type = type;
        this.name = name;
    }

    private Integer type;
    private String name;

    public Integer getType() {
        return type;
    }

    public CategoryTypeDescEnum setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getName() {
        return name;
    }

    public CategoryTypeDescEnum setName(String name) {
        this.name = name;
        return this;
    }

    public static CategoryTypeDescEnum getCategoryTypeDescEnumByType(Integer type){
        if(type == null){
            return null;
        }
        for(CategoryTypeDescEnum categoryTypeDescEnum : CategoryTypeDescEnum.values()){
            if(categoryTypeDescEnum.getType() == type){
                return categoryTypeDescEnum;
            }
        }
        return null;
    }
}
